﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@

@{
    ViewBag.Title = "编辑";
}
@model EditProfileViewModel
<div class="form-group row text-danger" asp-validation-summary="All"></div>
<form enctype="multipart/form-data" asp-controller="profile" asp-action="modify" method="post" class="mt-3">

    <div class="form-group row">
        <label asp-for="UserName" class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <input asp-for="UserName" class="form-control" placeholder="Name" />
            <span asp-validation-for="UserName" class="text-danger"></span>
        </div>
    </div>
    <div class="form-group row">
        <label asp-for="Email" class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <input asp-for="Email" class="form-control" placeholder="Email" />
            <span asp-validation-for="Email" class="text-danger"></span>
        </div>
    </div>
   
    <div class="form-group row">
        <label asp-for="Photo" class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <div class="custom-file">
                @*<input type="file" asp-for="Photo" class="form-control custom-file-input" />*@
                <label class="custom-file-label">请选择图片...</label>
            </div>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-sm-10">
            <button type="submit" class="btn btn-primary">修改</button>
        </div>
    </div>

    @section Scripts{
        <script>
            $(document).ready(function(){
                 $(".custom-file-input").on("change",function(){
                var fileName=$(this)
                .val()
                .split("\\")
                .pop();
                $(this)
                .next(".custom-file-label")
                .html(fileName);
            });
            });

        </script>
    }
</form>
<div class="form-group row">
   <div class="col-sm-10">
      <a class="btn btn-primary" asp-controller="home" asp-action="index">返回</a>
   </div>
</div>

